package com.company;

public class Main {

    public static void main(String[] args) {
	// write your code here
        int[] a={1,2,55,4,78,34,45,64,45,85};
        method(a);
        method1(a);
    }
    public static void method(int[] x){
        int sum=0;
        double pinjun=0;
        for (int i=0;i<x.length;i++){
              sum=sum+x[i];
              pinjun= sum/(double) x.length;
        }
        System.out.println(sum);
        System.out.println(pinjun);
    }
    public static void method1(int[] x){
          int max=x[0];int min=x[0];
         for (int i=0;i<x.length;i++){
             if (max<=x[i]){
                 max=x[i];
             }else if (min>=x[i]){
                 min=x[i];
             }

         }
            System.out.println(max);
            System.out.println(min);
    }
}
